//
//  XianLiangViewController.m
//  KCFurProject
//
//  Created by ios程序员 on 15/11/9.
//  Copyright (c) 2015年 ios程序员. All rights reserved.
//

#import "XianLiangViewController.h"
#import "XianLiang.h"

@interface XianLiangViewController ()<UITableViewDataSource,UITableViewDelegate>

@property (nonatomic ,strong) UITableView *tableView;

@end

@implementation XianLiangViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self tableViewSubViews];
}

- (void)tableViewSubViews
{
    self.tableView = [[UITableView alloc] initWithFrame:[UIScreen mainScreen].bounds style:UITableViewStyleGrouped];
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    self.tableView.rowHeight = 110*HEIGH;
    [self.view addSubview:self.tableView];
    self.tableView.separatorStyle = UITableViewCellEditingStyleNone;
    [self.tableView registerClass:[XianLiang class] forCellReuseIdentifier:@"reuse"];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 10;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    XianLiang *cell = [tableView dequeueReusableCellWithIdentifier:@"reuse"];
//    cell.priceLabel.backgroundColor = [UIColor brownColor];
//    cell.baoMingLabel.backgroundColor = [UIColor blueColor];
    [cell.slider addTarget:self action:@selector(sliderClick:) forControlEvents:UIControlEventTouchUpInside];
    [cell.baoMingButton addTarget:self action:@selector(baoMingButtonClick:) forControlEvents:UIControlEventTouchUpInside];
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:NO];
}


//slider方法
- (void)sliderClick:(UISlider *)slider
{
    
}
//开始报名方法
- (void)baoMingButtonClick:(UIButton *)button;
{
    XianLiang *cell = [[XianLiang alloc] init];
    int a = 0;
    [cell.slider setValue:a+=100 animated:NO];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
